package com.onlyxiahui.common.action.description.bean;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 
 * <br>
 * Date 2019-11-04 16:01:50<br>
 * 
 * @author XiaHui [onlovexiahui@qq.com]<br>
 * @since 1.0.0
 */

public class MethodData {

	private String key;
	private String name;
	private String title;
	private String description;
	private String className;

	private Set<String> actions;
	private List<String> paths;
	private List<String> methodTypes;
	private List<String> parameterTypes;
	private List<String> contentTypes;
	private Map<String, Object> extend;
	private List<ParameterData> parameters;
	private ResultData result;

	public MethodData() {
		actions = new HashSet<>();
		paths = new ArrayList<>();
		methodTypes = new ArrayList<>();
		parameterTypes = new ArrayList<>();
		contentTypes = new ArrayList<>();
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public List<String> getPaths() {
		return paths;
	}

	public void setPaths(List<String> paths) {
		this.paths = paths;
	}

	public List<String> getParameterTypes() {
		return parameterTypes;
	}

	public void setParameterTypes(List<String> parameterTypes) {
		this.parameterTypes = parameterTypes;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public Map<String, Object> getExtend() {
		return extend;
	}

	public void setExtend(Map<String, Object> extend) {
		this.extend = extend;
	}

	public List<ParameterData> getParameters() {
		return parameters;
	}

	public void setParameters(List<ParameterData> parameters) {
		this.parameters = parameters;
	}

	public ResultData getResult() {
		return result;
	}

	public void setResult(ResultData result) {
		this.result = result;
	}

	public List<String> getMethodTypes() {
		return methodTypes;
	}

	public void setMethodTypes(List<String> methodTypes) {
		this.methodTypes = methodTypes;
	}

	public List<String> getContentTypes() {
		return contentTypes;
	}

	public void setContentTypes(List<String> contentTypes) {
		this.contentTypes = contentTypes;
	}

	public Set<String> getActions() {
		return actions;
	}

	public void setActions(Set<String> actions) {
		this.actions = actions;
	}

	public void addMethodType(String type) {
		if (null == methodTypes) {
			methodTypes = new ArrayList<>();
		}
		methodTypes.add(type);
	}

	public void addParameterType(String type) {
		if (null == parameterTypes) {
			parameterTypes = new ArrayList<>();
		}
		parameterTypes.add(type);
	}

	public void addContentType(String type) {
		if (null == contentTypes) {
			contentTypes = new ArrayList<>();
		}
		contentTypes.add(type);
	}

	public void addPath(String path) {
		if (null == paths) {
			paths = new ArrayList<>();
		}
		paths.add(path);
	}

	public void addAction(String action) {
		if (null == actions) {
			actions = new HashSet<>();
		}
		actions.add(action);
	}
}
